﻿<?xml version="1.0" encoding="utf-8"?>
<!--
        作者：          liuleyi
        更新时间：      20170227
        用途：          生成存储过程默认模板
-->
<xsl:stylesheet version="2.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:fn="http://www.w3.org/2005/xpath-functions">
	<xsl:output method="text" indent="no" encoding="utf-8" byte-order-mark="no"/>  
	<xsl:template match="/">

	<xsl:variable name="StringTypeDefine" select="document('../model/0101_StringTypeDefine.xml')"/>
	<xsl:variable name="EnumTypeDefine" select="document('../model/0102_EnumTypeDefine.xml')"/>
	<xsl:variable name="BooleanTypeDefine" select="document('../model/0103_BooleanTypeDefine.xml')"/>
	<xsl:variable name="DateTypeDefine" select="document('../model/0104_DateTypeDefine.xml')"/>
	<xsl:variable name="NumberTypeDefine" select="document('../model/0105_NumberTypeDefine.xml')"/>
	<xsl:variable name="IntegerTypeDefine" select="document('../model/0106_IntegerTypeDefine.xml')"/>
	<xsl:variable name="FuncConfig" select="document('../model/0801_AdminFunNoConfig.xml')"/>
<xsl:for-each select="Tpls/lsts">
<xsl:for-each select="tpl">
<xsl:variable name="func" select="@func"/>
<xsl:variable name="fileName" select="concat('./generate/php/Admin/View/',@ctl,'/','lst','.html')"/>
<xsl:result-document encoding="utf-8" method="text" href="{$fileName}">&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;<xsl:value-of select="@title"/>&lt;/title&gt;
        &lt;link href=&quot;{$Think.const.ADMIN_CSS_URL}bootstrap.css&quot; rel=&quot;stylesheet&quot; /&gt;
        &lt;link href=&quot;{$Think.const.ADMIN_CSS_URL}lz-style.css&quot; rel=&quot;stylesheet&quot; /&gt;
        &lt;script src=&quot;{$Think.const.ADMIN_JS_URL}jquery.js&quot;&gt;&lt;/script&gt;
        &lt;script src=&quot;{$Think.const.ADMIN_JS_URL}bootstrap.js&quot;&gt;&lt;/script&gt;
        &lt;script src=&quot;{$Think.const.ADMIN_JS_URL}dataTables/jquery.dataTables.js&quot;&gt;&lt;/script&gt;
        &lt;script src=&quot;{$Think.const.ADMIN_JS_URL}dataTables/dataTables.bootstrap.js&quot;&gt;&lt;/script&gt;
        &lt;script src=&quot;{$Think.const.ADMIN_JS_URL}DatePicker/WdatePicker.js&quot;&gt;&lt;/script&gt;
        &lt;script&gt;
            $(document).ready(function () {
                $('#dataTables').dataTable({
                    paging: true,
                    searching: false,
                    showrownumber: true
                });
            });
        &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;div class=&quot;container&quot;&gt;
            &lt;div class=&quot;row div_head&quot; &gt;
                &lt;div class=&quot; col-xs-6 col-sm-6 text-primary&quot;&gt;
                    {$loction}
                &lt;/div&gt;
                &lt;div class=&quot; col-xs-6 col-sm-3&quot;&gt;&lt;/div&gt;
                &lt;div class=&quot; col-xs-6 col-sm-3&quot;&gt;
                    &lt;a style=&quot;text-decoration: none;&quot; href=&quot;__CONTROLLER__/add&quot;&gt;【添加】&lt;/a&gt;
                &lt;/div&gt;
            &lt;/div&gt;
            &lt;hr /&gt;
            &lt;div class=&quot;row div_form&quot; &gt;
                &lt;form action=&quot;__SELF__&quot; method=&quot;post&quot;&gt;
<xsl:for-each select="$FuncConfig//FunNo[@code=$func]"><xsl:for-each select="Request/Column">
<xsl:variable name="typeTable" select="@name"/>
<xsl:variable name="require" select="@require"/>
<xsl:for-each select="$StringTypeDefine//String[@typename=$typeTable]">&lt;div class=&quot;text-right col-xs-6 col-sm-3 &quot; &gt;&lt;label for=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;control-label&quot;&gt;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}:&lt;/label&gt;&lt;/div&gt;
                    &lt;div class=&quot;col-xs-6 col-sm-3 div_text&quot; &gt;
                        &lt;input type=&quot;text&quot; id=&quot;<xsl:value-of select="@typename"/>&quot; name=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;form-control&quot; placeholder=&quot;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}&quot;  value=&quot;&quot; maxlength="<xsl:value-of select="@length"/>"/&gt;
                    &lt;/div&gt;
</xsl:for-each>
<xsl:for-each select="$EnumTypeDefine//Enum[@typename=$typeTable]">&lt;div class=&quot;text-right col-xs-6 col-sm-3 &quot; &gt;&lt;label for=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;control-label&quot;&gt;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}:&lt;/label&gt;&lt;/div&gt;
                    &lt;div class=&quot;col-xs-6 col-sm-3&quot; &gt;
        &lt;select id=&quot;<xsl:value-of select="@typename"/>&quot; name=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;form-control&quot; &gt;
            &lt;option value=&quot;&quot; style=&quot;display: none&quot;&gt;&lt;/option&gt;
            &lt;foreach name=&quot;GV_Enum.<xsl:value-of select="@typename"/>&quot; item=&quot;row&quot; key=&quot;k&quot;&gt;
                &lt;option value=&quot;{$k}&quot;&gt;{$k}-{$row}&lt;/option&gt;
            &lt;/foreach&gt;
        &lt;/select&gt;
                    &lt;/div&gt;
</xsl:for-each>
<xsl:for-each select="$BooleanTypeDefine//Boolean[@typename=$typeTable]">&lt;div class=&quot;text-right col-xs-6 col-sm-3 &quot; &gt;&lt;label for=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;control-label&quot;&gt;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}:&lt;/label&gt;&lt;/div&gt;
                    &lt;div class=&quot;col-xs-6 col-sm-3&quot; &gt;
        &lt;select id=&quot;<xsl:value-of select="@typename"/>&quot; name=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;form-control&quot; &gt;
            &lt;option value=&quot;&quot; style=&quot;display: none&quot;&gt;&lt;/option&gt;
            &lt;foreach name=&quot;GV_Enum.<xsl:value-of select="@typename"/>&quot; item=&quot;row&quot; key=&quot;k&quot;&gt;
                &lt;option value=&quot;{$k}&quot;&gt;{$k}-{$row}&lt;/option&gt;
            &lt;/foreach&gt;
        &lt;/select&gt;
                    &lt;/div&gt;
</xsl:for-each>
<xsl:for-each select="$DateTypeDefine//Date[@typename=$typeTable]">&lt;div class=&quot;text-right col-xs-6 col-sm-3 &quot; &gt;&lt;label for=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;control-label&quot;&gt;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}:&lt;/label&gt;&lt;/div&gt;
                    &lt;div class=&quot;col-xs-6 col-sm-3&quot; &gt;
                        &lt;input type=&quot;text&quot; id=&quot;<xsl:value-of select="@typename"/>&quot; name=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;form-control Wdate&quot; placeholder=&quot;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}&quot; onClick=&quot;WdatePicker({el: this, isShowClear: false, readOnly: true, skin: 'whyGreen', dateFmt: 'yyyy/MM/dd'})&quot;  /&gt;
                    &lt;/div&gt;
</xsl:for-each>
<xsl:for-each select="$NumberTypeDefine//Number[@typename=$typeTable]">&lt;div class=&quot;text-right col-xs-6 col-sm-3 &quot; &gt;&lt;label for=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;control-label&quot;&gt;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}:&lt;/label&gt;&lt;/div&gt;
                    &lt;div class=&quot;col-xs-6 col-sm-3 div_number&quot; &gt;
                        &lt;input type=&quot;number&quot; id=&quot;<xsl:value-of select="@typename"/>&quot; name=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;form-control&quot; placeholder=&quot;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}&quot;  value=&quot;&quot; />/&gt;
                    &lt;/div&gt;
</xsl:for-each>
<xsl:for-each select="$IntegerTypeDefine//Integer[@typename=$typeTable]">&lt;div class=&quot;text-right col-xs-6 col-sm-3 &quot; &gt;&lt;label for=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;control-label&quot;&gt;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}:&lt;/label&gt;&lt;/div&gt;
                    &lt;div class=&quot;col-xs-6 col-sm-3 div_number&quot; &gt;
                        &lt;input type=&quot;number&quot; id=&quot;<xsl:value-of select="@typename"/>&quot; name=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;form-control&quot; placeholder=&quot;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}&quot;  value=&quot;&quot;/>/&gt;
                    &lt;/div&gt;
</xsl:for-each>
                    
</xsl:for-each></xsl:for-each>


                    &lt;div class=&quot;col-xs-6 col-sm-3&quot;&gt;
                        &lt;input type=&quot;submit&quot; id=&quot;search&quot;  class=&quot;btn btn-default&quot; value=&quot;查询&quot;&gt;
                    &lt;/div&gt;

                &lt;/form&gt;
                &lt;div id=&quot;error&quot; class=&quot;row text-danger&quot;&gt;&lt;/div&gt;
                &lt;div id=&quot;success&quot; class=&quot;row text-success&quot;&gt;&lt;/div&gt;
            &lt;/div&gt;
            &lt;hr /&gt;
            &lt;div class=&quot;row div_content&quot; &gt;
                &lt;div class=&quot;col-md-12&quot;&gt;
                    &lt;div class=&quot;table-responsive"&gt;
                        &lt;table class=&quot;table table-striped table-bordered table-hover table-condensed&quot; id=&quot;dataTables&quot; border=&quot;1&quot;&gt;
                            &lt;thead>
                                &lt;tr>
                                    &lt;th class=&quot;div_tab_head&quot;&gt;序号&lt;/th&gt;
<xsl:for-each select="$FuncConfig//FunNo[@code=$func]"><xsl:for-each select="Response/Column">
<xsl:variable name="typeTable" select="@name"/>
                    &lt;th class=&quot;div_tab_head&quot;&gt;{$Think.const.LB_<xsl:value-of select="upper-case(@name)"/>}&lt;/th&gt;
</xsl:for-each></xsl:for-each>
                                    &lt;th class=&quot;div_tab_head&quot;&gt;操作&lt;/th&gt;
                                &lt;/tr>
                            &lt;/thead>
                            &lt;tbody>
                            &lt;foreach name=&quot;lst&quot; item=&quot;row&quot; &gt;
                                &lt;tr>
                                    &lt;td class=&quot;div_tab_cell&quot;&gt;{$key+1}&lt;/td&gt;
<xsl:for-each select="$FuncConfig//FunNo[@code=$func]"><xsl:for-each select="Response/Column">
<xsl:variable name="typeTable" select="@name"/>
<xsl:for-each select="$StringTypeDefine//String[@typename=$typeTable]">                    &lt;td class=&quot;div_tab_cell div_tab_cell_text&quot;&gt;{$row.<xsl:value-of select="lower-case(@typename)"/>|stripcslashes}&lt;/td&gt;
</xsl:for-each>
<xsl:for-each select="$EnumTypeDefine//Enum[@typename=$typeTable]">                    
&lt;assign name=&quot;var_<xsl:value-of select="lower-case(@typename)"/>&quot; value=&quot;$row.<xsl:value-of select="lower-case(@typename)"/>&quot; /&gt;
&lt;td class=&quot;div_tab_cell div_tab_cell_text&quot;&gt;{$GV_Enum.<xsl:value-of select="@typename"/>.$var_<xsl:value-of select="lower-case(@typename)"/>|stripcslashes}&lt;/td&gt;
</xsl:for-each>
<xsl:for-each select="$BooleanTypeDefine//Boolean[@typename=$typeTable]"> &lt;assign name=&quot;var_<xsl:value-of select="lower-case(@typename)"/>&quot; value=&quot;$row.<xsl:value-of select="lower-case(@typename)"/>&quot; /&gt;
&lt;td class=&quot;div_tab_cell div_tab_cell_text&quot;&gt;{$GV_Enum.<xsl:value-of select="@typename"/>.$var_<xsl:value-of select="lower-case(@typename)"/>|stripcslashes}&lt;/td&gt;
</xsl:for-each>
<xsl:for-each select="$DateTypeDefine//Date[@typename=$typeTable]">                    &lt;td class=&quot;div_tab_cell div_tab_cell_date&quot;&gt;{$row.<xsl:value-of select="lower-case(@typename)"/>}&lt;/td&gt;
</xsl:for-each>
<xsl:for-each select="$NumberTypeDefine//Number[@typename=$typeTable]">                    &lt;td class=&quot;div_tab_cell div_tab_cell_num&quot;&gt;{$row.<xsl:value-of select="lower-case(@typename)"/>|stripcslashes}&lt;/td&gt;
</xsl:for-each>
<xsl:for-each select="$IntegerTypeDefine//Integer[@typename=$typeTable]">                    &lt;td class=&quot;div_tab_cell div_tab_cell_num&quot;&gt;{$row.<xsl:value-of select="lower-case(@typename)"/>|stripcslashes}&lt;/td&gt;
</xsl:for-each>
</xsl:for-each></xsl:for-each>
                                    &lt;td align=&quot;center&quot; class=&quot;div_tab_cell&quot;&gt;&lt;div class=&quot;btn-group&quot;&gt;
                                            &lt;a id=&quot;edit&quot; type=&quot;button&quot; class=&quot;btn btn-default&quot; href=&quot;__CONTROLLER__/edit/<xsl:value-of select="@pk"/>/{$row.<xsl:value-of select="lower-case(@pk)"/>}&quot;&gt;&lt;span class=&quot;glyphicon glyphicon-pencil&quot;&gt;&lt;/span&gt;&lt;/a&gt;
                                            &lt;a id=&quot;delete&quot; type=&quot;button&quot; class=&quot;btn btn-default&quot;href=&quot;__CONTROLLER__/del/<xsl:value-of select="@pk"/>/{$row.<xsl:value-of select="lower-case(@pk)"/>}&quot; onClick=&quot;if (confirm('确定要删除吗？'))
                                                        return true;
                                                    else
                                                        return false;&quot;>&lt;span class=&quot;glyphicon glyphicon-remove&quot;&gt;&lt;/span&gt;&lt;/a&gt;
                                        &lt;/div&gt;&lt;/td&gt;
                                &lt;/tr&gt;
                            &lt;/foreach&gt;
                            &lt;/tbody&gt;
                        &lt;/table&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;

    &lt;/body&gt;
&lt;/html&gt;
</xsl:result-document>
</xsl:for-each>
</xsl:for-each>
<xsl:for-each select="Tpls/adds">
<xsl:for-each select="tpl">
<xsl:variable name="func" select="@func"/>
<xsl:variable name="fileName" select="concat('./generate/php/Admin/View/',@ctl,'/','add','.html')"/>
<xsl:result-document encoding="utf-8" method="text" href="{$fileName}">&lt;html&gt;
    &lt;head>
        &lt;title><xsl:value-of select="@title"/>&lt;/title&gt;
        &lt;link href=&quot;{$Think.const.ADMIN_CSS_URL}bootstrap.css&quot; rel=&quot;stylesheet&quot; /&gt;
        &lt;link href=&quot;{$Think.const.ADMIN_CSS_URL}lz-style.css&quot; rel=&quot;stylesheet&quot; /&gt;
        &lt;script src=&quot;{$Think.const.ADMIN_JS_URL}jquery.js&quot;&gt;&lt;/script&gt;
        &lt;script src=&quot;{$Think.const.ADMIN_JS_URL}jquery.form.js&quot;&gt;&lt;/script&gt;
        &lt;script src=&quot;{$Think.const.ADMIN_JS_URL}bootstrap.js&quot;&gt;&lt;/script&gt;
        &lt;script src=&quot;{$Think.const.ADMIN_JS_URL}DatePicker/WdatePicker.js&quot;&gt;&lt;/script&gt;
        &lt;script language=&quot;JavaScript&quot;&gt;

            $(function () {
                $('#addform').ajaxForm({
                    beforeSubmit: checkForm, // pre-submit callback
                    success: complete, // post-submit callback
                    dataType: 'json'
                });
                function checkForm() {
<xsl:for-each select="$FuncConfig//FunNo[@code=$func]"><xsl:for-each select="Request/Column[@isRequired='true']">
<xsl:variable name="typeTable" select="@name"/>
                    if ('' == $.trim($('#<xsl:value-of select="@name"/>').val())) {
                        $('#success').hide();
                        $('#error').html('[{$Think.const.LB_<xsl:value-of select="upper-case(@name)"/>}]不能为空').show();
                        return false;
                    }
</xsl:for-each></xsl:for-each>
                    //可以在此添加其它判断
                }
                function complete(data) {
                    if (data.status === 1) {
                        $('#error').hide();
                        $('#success').html(data.info).show();
                    } else {
                        $('#success').hide();
                        $('#error').html(data.info).show();
                    }
                }

            });

        &lt;/script&gt;

    &lt;/head&gt;
    &lt;body&gt;
        &lt;div class=&quot;container&quot;&gt;
            &lt;div class=&quot;row div_head&quot; &gt;
                &lt;div class=&quot; col-xs-6 col-sm-6 text-primary&quot;&gt;
                                 {$loction}
                &lt;/div&gt;
                &lt;div class=&quot;col-xs-6 col-sm-3&quot;&gt;&lt;/div&gt;
                &lt;div class=&quot;col-xs-6 col-sm-3&quot;&gt;
                    &lt;a style=&quot;text-decoration: none&quot; href=&quot;__CONTROLLER__/lst&quot;&gt;【返回】&lt;/a&gt;
                &lt;/div&gt;
            &lt;/div&gt;

            &lt;hr /&gt;
            &lt;div class=&quot;row div_form&quot; &gt;
                &lt;form id=&quot;addform&quot; action=&quot;__SELF__&quot; method=&quot;post&quot;&gt;
<xsl:for-each select="$FuncConfig//FunNo[@code=$func]"><xsl:for-each select="Request/Column">
<xsl:variable name="typeTable" select="@name"/>
<xsl:variable name="isRequired" select="@isRequired"/>
<xsl:for-each select="$StringTypeDefine//String[@typename=$typeTable]">&lt;div class=&quot;text-right col-xs-6 col-sm-3 <xsl:if test="$isRequired='true'">div_required</xsl:if>&quot; &gt;&lt;label for=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;control-label&quot;&gt;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}:&lt;/label&gt;&lt;/div&gt;
                    &lt;div class=&quot;col-xs-6 col-sm-3 div_text&quot; &gt;
                        &lt;input type=&quot;text&quot; id=&quot;<xsl:value-of select="@typename"/>&quot; name=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;form-control&quot; placeholder=&quot;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}&quot;   maxlength="<xsl:value-of select="@length"/>" <xsl:text>  </xsl:text><xsl:if test="$isRequired='true'">required</xsl:if> /&gt;
                    &lt;/div&gt;
</xsl:for-each>
<xsl:for-each select="$EnumTypeDefine//Enum[@typename=$typeTable]">&lt;div class=&quot;text-right col-xs-6 col-sm-3 <xsl:if test="$isRequired='true'">div_required</xsl:if>&quot; &gt;&lt;label for=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;control-label&quot;&gt;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}:&lt;/label&gt;&lt;/div&gt;
                    &lt;div class=&quot;col-xs-6 col-sm-3&quot; &gt;
        &lt;select id=&quot;<xsl:value-of select="@typename"/>&quot; name=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;form-control&quot; <xsl:text>  </xsl:text><xsl:if test="$isRequired='true'">required</xsl:if>&gt;
            &lt;option value=&quot;&quot; style=&quot;display: none&quot;&gt;&lt;/option&gt;
            &lt;foreach name=&quot;GV_Enum.<xsl:value-of select="@typename"/>&quot; item=&quot;row&quot; key=&quot;k&quot;&gt;
                &lt;option value=&quot;{$k}&quot;&gt;{$k}-{$row}&lt;/option&gt;
            &lt;/foreach&gt;
        &lt;/select&gt;
                    &lt;/div&gt;
</xsl:for-each>
<xsl:for-each select="$BooleanTypeDefine//Boolean[@typename=$typeTable]">&lt;div class=&quot;text-right col-xs-6 col-sm-3 <xsl:if test="$isRequired='true'">div_required</xsl:if>&quot; &gt;&lt;label for=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;control-label&quot;&gt;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}:&lt;/label&gt;&lt;/div&gt;
                    &lt;div class=&quot;col-xs-6 col-sm-3&quot; &gt;
        &lt;select id=&quot;<xsl:value-of select="@typename"/>&quot; name=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;form-control&quot;  <xsl:text>  </xsl:text><xsl:if test="$isRequired='true'">required</xsl:if>&gt;
            &lt;option value=&quot;&quot; style=&quot;display: none&quot;&gt;&lt;/option&gt;
            &lt;foreach name=&quot;GV_Enum.<xsl:value-of select="@typename"/>&quot; item=&quot;row&quot; key=&quot;k&quot;&gt;
                &lt;option value=&quot;{$k}&quot;&gt;{$k}-{$row}&lt;/option&gt;
            &lt;/foreach&gt;
        &lt;/select&gt;
                    &lt;/div&gt;
</xsl:for-each>
<xsl:for-each select="$DateTypeDefine//Date[@typename=$typeTable]">&lt;div class=&quot;text-right col-xs-6 col-sm-3 <xsl:if test="$isRequired='true'">div_required</xsl:if>&quot; &gt;&lt;label for=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;control-label&quot;&gt;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}:&lt;/label&gt;&lt;/div&gt;
                    &lt;div class=&quot;col-xs-6 col-sm-3&quot; &gt;
                        &lt;input type=&quot;text&quot; id=&quot;<xsl:value-of select="@typename"/>&quot; name=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;form-control Wdate&quot; placeholder=&quot;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}&quot; onClick=&quot;WdatePicker({el: this, isShowClear: false, readOnly: true, skin: 'whyGreen', dateFmt: 'yyyy/MM/dd'})&quot;  <xsl:text>  </xsl:text><xsl:if test="$isRequired='true'">required</xsl:if>/&gt;
                    &lt;/div&gt;
</xsl:for-each>
<xsl:for-each select="$NumberTypeDefine//Number[@typename=$typeTable]">&lt;div class=&quot;text-right col-xs-6 col-sm-3 <xsl:if test="$isRequired='true'">div_required</xsl:if>&quot; &gt;&lt;label for=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;control-label&quot;&gt;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}:&lt;/label&gt;&lt;/div&gt;
                    &lt;div class=&quot;col-xs-6 col-sm-3 div_number&quot; &gt;
                        &lt;input type=&quot;number&quot; id=&quot;<xsl:value-of select="@typename"/>&quot; name=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;form-control&quot; placeholder=&quot;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}&quot;   <xsl:text>  </xsl:text><xsl:if test="$isRequired='true'">required</xsl:if>/&gt;
                    &lt;/div&gt;
</xsl:for-each>
<xsl:for-each select="$IntegerTypeDefine//Integer[@typename=$typeTable]">&lt;div class=&quot;text-right col-xs-6 col-sm-3 <xsl:if test="$isRequired='true'">div_required</xsl:if> &quot; &gt;&lt;label for=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;control-label&quot;&gt;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}:&lt;/label&gt;&lt;/div&gt;
                    &lt;div class=&quot;col-xs-6 col-sm-3 div_number&quot; &gt;
                        &lt;input type=&quot;number&quot; id=&quot;<xsl:value-of select="@typename"/>&quot; name=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;form-control&quot; placeholder=&quot;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}&quot;   <xsl:text>  </xsl:text><xsl:if test="$isRequired='true'">required</xsl:if>/&gt;
                    &lt;/div&gt;
</xsl:for-each>
</xsl:for-each></xsl:for-each>
                    &lt;div class=&quot;col-xs-6 col-sm-3&quot;&gt;
                        &lt;input type=&quot;submit&quot; id=&quot;search&quot;  class=&quot;btn btn-default&quot; value=&quot;提交&quot;&gt;
                        &lt;input type=&quot;reset&quot; class=&quot;btn btn-default&quot; value=&quot;清 空&quot;&gt;
                    &lt;/div&gt;

                &lt;/form&gt;
            &lt;/div&gt;
            &lt;div id=&quot;error&quot; class=&quot;row text-danger&quot;&gt;&lt;/div&gt;
            &lt;div id=&quot;success&quot; class=&quot;row text-success&quot;&gt;&lt;/div&gt;

        &lt;/div&gt;

    &lt;/body&gt;
&lt;/html&gt;
</xsl:result-document>
</xsl:for-each>
</xsl:for-each>
<xsl:for-each select="Tpls/edits">
<xsl:for-each select="tpl">
<xsl:variable name="func" select="@func"/>
<xsl:variable name="fileName" select="concat('./generate/php/Admin/View/',@ctl,'/','edit','.html')"/>
<xsl:result-document encoding="utf-8" method="text" href="{$fileName}">&lt;html&gt;
    &lt;head>
        &lt;title><xsl:value-of select="@title"/>&lt;/title&gt;
        &lt;link href=&quot;{$Think.const.ADMIN_CSS_URL}bootstrap.css&quot; rel=&quot;stylesheet&quot; /&gt;
        &lt;link href=&quot;{$Think.const.ADMIN_CSS_URL}lz-style.css&quot; rel=&quot;stylesheet&quot; /&gt;
        &lt;script src=&quot;{$Think.const.ADMIN_JS_URL}jquery.js&quot;&gt;&lt;/script&gt;
        &lt;script src=&quot;{$Think.const.ADMIN_JS_URL}jquery.form.js&quot;&gt;&lt;/script&gt;
        &lt;script src=&quot;{$Think.const.ADMIN_JS_URL}bootstrap.js&quot;&gt;&lt;/script&gt;
        &lt;script src=&quot;{$Think.const.ADMIN_JS_URL}DatePicker/WdatePicker.js&quot;&gt;&lt;/script&gt;
        &lt;script language=&quot;JavaScript&quot;&gt;

            $(function () {
                $('#editform').ajaxForm({
                    beforeSubmit: checkForm, // pre-submit callback
                    success: complete, // post-submit callback
                    dataType: 'json'
                });
                function checkForm() {
<xsl:for-each select="$FuncConfig//FunNo[@code=$func]"><xsl:for-each select="Request/Column[@isRequired='true']">
<xsl:variable name="typeTable" select="@name"/>
                    if ('' == $.trim($('#<xsl:value-of select="@name"/>').val())) {
                        $('#success').hide();
                        $('#error').html('[{$Think.const.LB_<xsl:value-of select="upper-case(@name)"/>}]不能为空').show();
                        return false;
                    }
</xsl:for-each></xsl:for-each>
                }
                function complete(data) {
                    if (data.status === 1) {
                        $('#error').hide();
                        $('#success').html(data.info).show();
                    } else {
                        $('#success').hide();
                        $('#error').html(data.info).show();
                    }
                }

            });

        &lt;/script&gt;

    &lt;/head&gt;
    &lt;body&gt;
        &lt;div class=&quot;container&quot;&gt;
            &lt;div class=&quot;row div_head&quot; &gt;
                &lt;div class=&quot; col-xs-6 col-sm-6 text-primary&quot;&gt;
                              {$loction}
                &lt;/div&gt;
                &lt;div class=&quot;col-xs-6 col-sm-3&quot;&gt;&lt;/div&gt;
                &lt;div class=&quot;col-xs-6 col-sm-3&quot;&gt;
                    &lt;a style=&quot;text-decoration: none&quot; href=&quot;__CONTROLLER__/lst&quot;&gt;【返回】&lt;/a&gt;
                &lt;/div&gt;
            &lt;/div&gt;

            &lt;hr /&gt;
            &lt;div class=&quot;row div_form&quot; &gt;
                &lt;form id=&quot;editform&quot; action=&quot;__SELF__&quot; method=&quot;post&quot;&gt;
<xsl:for-each select="$FuncConfig//FunNo[@code=$func]"><xsl:for-each select="Request/Column">
<xsl:variable name="typeTable" select="@name"/>
<xsl:variable name="isRequired" select="@isRequired"/>
<xsl:for-each select="$StringTypeDefine//String[@typename=$typeTable]">&lt;div class=&quot;text-right col-xs-6 col-sm-3 <xsl:if test="$isRequired='true'">div_required</xsl:if>&quot; &gt;&lt;label for=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;control-label&quot;&gt;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}:&lt;/label&gt;&lt;/div&gt;
                    &lt;div class=&quot;col-xs-6 col-sm-3 div_text&quot; &gt;
                        &lt;input type=&quot;text&quot; id=&quot;<xsl:value-of select="@typename"/>&quot; name=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;form-control&quot; placeholder=&quot;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}&quot;  value=&quot;{$post.<xsl:value-of select="lower-case(@typename)"/>}&quot; maxlength="<xsl:value-of select="@length"/>" <xsl:text>  </xsl:text><xsl:if test="$isRequired='true'">required</xsl:if> /&gt;
                    &lt;/div&gt;
</xsl:for-each>
<xsl:for-each select="$EnumTypeDefine//Enum[@typename=$typeTable]">&lt;div class=&quot;text-right col-xs-6 col-sm-3 <xsl:if test="$isRequired='true'">div_required</xsl:if>&quot; &gt;&lt;label for=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;control-label&quot;&gt;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}:&lt;/label&gt;&lt;/div&gt;
                    &lt;div class=&quot;col-xs-6 col-sm-3&quot; &gt;
        &lt;select id=&quot;<xsl:value-of select="@typename"/>&quot; name=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;form-control&quot; value=&quot;{$post.<xsl:value-of select="lower-case(@typename)"/>}&quot; <xsl:text>  </xsl:text><xsl:if test="$isRequired='true'">required</xsl:if>&gt;
            &lt;option value=&quot;&quot; style=&quot;display: none&quot;&gt;&lt;/option&gt;
            &lt;foreach name=&quot;GV_Enum.<xsl:value-of select="@typename"/>" item=&quot;row&quot; key=&quot;k&quot;&gt;
            &lt;if condition=&quot;$k eq $post.<xsl:value-of select="lower-case(@typename)"/> &quot;&gt;
            &lt;option value=&quot;{$k}&quot; selected = &quot;selected&quot; &gt;{$k}-{$row}&lt;/option&gt;
            &lt;else /&gt;
            &lt;option value=&quot;{$k}&quot; &gt;{$k}-{$row}&lt;/option&gt;
            &lt;/if&gt;
            &lt;/foreach&gt;
        &lt;/select&gt;
                    &lt;/div&gt;
</xsl:for-each>
<xsl:for-each select="$BooleanTypeDefine//Boolean[@typename=$typeTable]">&lt;div class=&quot;text-right col-xs-6 col-sm-3 <xsl:if test="$isRequired='true'">div_required</xsl:if>&quot; &gt;&lt;label for=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;control-label&quot;&gt;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}:&lt;/label&gt;&lt;/div&gt;
                    &lt;div class=&quot;col-xs-6 col-sm-3&quot; &gt;
        &lt;select id=&quot;<xsl:value-of select="@typename"/>&quot; name=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;form-control&quot; value=&quot;{$post.<xsl:value-of select="lower-case(@typename)"/>}&quot; <xsl:text>  </xsl:text><xsl:if test="$isRequired='true'">required</xsl:if>&gt;
            &lt;option value=&quot;&quot; style=&quot;display: none&quot;&gt;&lt;/option&gt;
            &lt;foreach name=&quot;GV_Enum.<xsl:value-of select="@typename"/>&quot; item=&quot;row&quot;key=&quot;k&quot;&gt;
            &lt;if condition=&quot;$k eq $post.<xsl:value-of select="lower-case(@typename)"/> &quot;&gt;
            &lt;option value=&quot;{$k}&quot; selected = &quot;selected&quot; &gt;{$k}-{$row}&lt;/option&gt;
            &lt;else /&gt;
            &lt;option value=&quot;{$k}&quot; &gt;{$k}-{$row}&lt;/option&gt;
            &lt;/if&gt;
            &lt;/foreach&gt;
        &lt;/select&gt;
                    &lt;/div&gt;
</xsl:for-each>
<xsl:for-each select="$DateTypeDefine//Date[@typename=$typeTable]">&lt;div class=&quot;text-right col-xs-6 col-sm-3 <xsl:if test="$isRequired='true'">div_required</xsl:if>&quot; &gt;&lt;label for=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;control-label&quot;&gt;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}:&lt;/label&gt;&lt;/div&gt;
                    &lt;div class=&quot;col-xs-6 col-sm-3&quot; &gt;
                        &lt;input type=&quot;text&quot; id=&quot;<xsl:value-of select="@typename"/>&quot; name=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;form-control Wdate&quot; placeholder=&quot;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}&quot; onClick=&quot;WdatePicker({el: this, isShowClear: false, readOnly: true, skin: 'whyGreen', dateFmt: 'yyyy/MM/dd'})&quot;  value=&quot;{$post.<xsl:value-of select="lower-case(@typename)"/>}&quot;<xsl:text>  </xsl:text><xsl:if test="$isRequired='true'">required</xsl:if>/&gt;
                    &lt;/div&gt;
</xsl:for-each>
<xsl:for-each select="$NumberTypeDefine//Number[@typename=$typeTable]">&lt;div class=&quot;text-right col-xs-6 col-sm-3 <xsl:if test="$isRequired='true'">div_required</xsl:if>&quot; &gt;&lt;label for=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;control-label&quot;&gt;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}:&lt;/label&gt;&lt;/div&gt;
                    &lt;div class=&quot;col-xs-6 col-sm-3 div_number&quot; &gt;
                        &lt;input type=&quot;number&quot; id=&quot;<xsl:value-of select="@typename"/>&quot; name=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;form-control&quot; placeholder=&quot;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}&quot;  value=&quot;{$post.<xsl:value-of select="lower-case(@typename)"/>}&quot; <xsl:text>  </xsl:text><xsl:if test="$isRequired='true'">required</xsl:if>/&gt;
                    &lt;/div&gt;
</xsl:for-each>
<xsl:for-each select="$IntegerTypeDefine//Integer[@typename=$typeTable]">&lt;div class=&quot;text-right col-xs-6 col-sm-3 <xsl:if test="$isRequired='true'">div_required</xsl:if> &quot; &gt;&lt;label for=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;control-label&quot;&gt;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}:&lt;/label&gt;&lt;/div&gt;
                    &lt;div class=&quot;col-xs-6 col-sm-3 div_number&quot; &gt;
                        &lt;input type=&quot;number&quot; id=&quot;<xsl:value-of select="@typename"/>&quot; name=&quot;<xsl:value-of select="@typename"/>&quot; class=&quot;form-control&quot; placeholder=&quot;{$Think.const.LB_<xsl:value-of select="upper-case(@typename)"/>}&quot;  value=&quot;{$post.<xsl:value-of select="lower-case(@typename)"/>}&quot; <xsl:text>  </xsl:text><xsl:if test="$isRequired='true'">required</xsl:if>/&gt;
                    &lt;/div&gt;
</xsl:for-each>
</xsl:for-each></xsl:for-each>
                    &lt;div class=&quot;col-xs-6 col-sm-3&quot;&gt;
                        &lt;input type=&quot;submit&quot; id=&quot;search&quot;  class=&quot;btn btn-default&quot; value=&quot;提交&quot;&gt;
                    &lt;/div&gt;

                &lt;/form&gt;
            &lt;/div&gt;
            &lt;div id=&quot;error&quot; class=&quot;row text-danger&quot;&gt;&lt;/div&gt;
            &lt;div id=&quot;success&quot; class=&quot;row text-success&quot;&gt;&lt;/div&gt;

        &lt;/div&gt;

    &lt;/body&gt;
&lt;/html&gt;
</xsl:result-document>
</xsl:for-each>
</xsl:for-each>
</xsl:template>  
</xsl:stylesheet>